package cc.lucien.adapter;

/**
 * @author lucien-ma
 * @date 2021/11/7
 * @apiNote
 */
public class PlayerAdapter implements MusicPlayer {

    private MyPlayer myPlayer;

    public PlayerAdapter() {
        this.myPlayer = new MyPlayer();
    }

    @Override
    public void play(String type, String filename) {
        if ("mp3".equals(type)) {
            this.myPlayer.playMp3(filename);
        }
        if ("wma".equals(type)) {
            this.myPlayer.playWma(filename);
        }
    }
}
